<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="lib/html5.js"></script>
	<script type="text/javascript" src="lib/respond.min.js"></script>
	<script type="text/javascript" src="lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="__PUBLIC__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/css/style.css" rel="stylesheet" type="text/css" />
	<link href="__PUBLIC__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="Tpl/Admin/common/form.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
	<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>家庭列表</title>
</head>
<body>
	<nav class="breadcrumb"> <i class="Hui-iconfont">&#xe67f;</i>
		首页
		<span class="c-gray en">&gt;</span>
		家庭管理
		<span class="c-gray en">&gt;</span>
		家庭列表
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" > <i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	<div class="pd-20">
		<!-- <div class="text-c"> 日期范围：
			<input type="text" onfocus="WdatePicker()" id="datemin" class="input-text Wdate" style="width:120px;">
			-
			<input type="text" onfocus="WdatePicker()" id="datemax" class="input-text Wdate" style="width:120px;">
			<input type="text" class="input-text" style="width:250px" placeholder="输入家庭名称或地址" id="" name="">
			<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜家庭</button>
		</div> -->
		<div class="text-c">
			<form action="" method="POST">
				<input type="text" class="input-text" style="width:250px" placeholder="输入家庭名称或地址" id="searchName" name="keyword">
				<span type="submit" class="btn btn-success radius searchButton" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜家庭</span>

			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
				<a href="javascript:;" class="btn btn-danger radius familyDelBat">
					<i class="Hui-iconfont">&#xe6e2;</i>
					批量删除
				</a>
				<a href="javascript:;" onclick="family_create('添加家庭','{:U('Family/create')}','','500',this)" class="btn btn-primary radius addfamily" uid="">
					<i class="Hui-iconfont">&#xe600;</i>
					添加家庭
				</a>
			</span>
			<!-- <span class="r">
				共有数据： <strong>54</strong>
				条
			</span> -->
		</div>
		<table class="table table-border table-bordered table-bg" id="familyTable">
			<thead>
				<tr>
					<th scope="col" colspan="8">家庭列表</th>
				</tr>
				<tr class="text-c">
					<th width="25">
						<input type="checkbox" name="" value="">
					</th>
					<th width="25">ID</th>
					<th width="25">家庭编号</th>
					<th width="200">所在位置</th>
					<th width="100">创建时间</th>
					<th width="100">关闭时间</th>
					<th width="100">状态</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody class="perTableTbody">
				<tr class="text-c">
					<td>
						<input type="checkbox" value="1" name=""></td>
					<td>加载中···</td>
					<td>加载中···</td>
					<td>加载中···</td>
					<td>加载中···</td>
					<td>加载中···</td>
					<td>加载中···</td>
					<td>
						<a title="编辑" href="javascript:;" onclick="admin_permission_edit('角色编辑','{:U('User/permission_edit')}','1','','310')" class="ml-5" style="text-decoration:none">
							<i class="Hui-iconfont">&#xe6df;</i>
						</a>
						<a title="删除" href="javascript:;" onclick="admin_permission_del(this,'1')" class="ml-5" style="text-decoration:none">
							<i class="Hui-iconfont">&#xe6e2;</i>
						</a>
					</td>
				</tr>
			</tbody>
		</table>
		
	</div>
	<!-- 添加界面 -->
	<div class="pd-20 familyAdd">
	<form action="" method="post" class="form form-horizontal" id="form-family-add">
	<input type="hidden" value="" name="id" id="uid">
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>所属小区：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text room_name" value="" placeholder="" name="">
				<input type="hidden" class="input-text room_id" value="" placeholder="" name="room_id">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>家庭编号：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="请输入两位家庭编号" id="no" name="no" datatype="n2-2" errormsg="请输入两位家庭编号" nullmsg="请输入家庭编号：">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>家庭分组：</label>
			<div class="formControls col-5">
				<span class="select-box">
			      <select class="select familyType" size="1" name="type" nullmsg='请选择家庭分组' datatype="*">
			      </select>
			    </span>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>入驻时间：</label>
			<div class="formControls col-5">
				<input type="text" onfocus="WdatePicker()" class="input-text create_time" value="" placeholder="" id="" name="create_time">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">搬离时间：</label>
			<div class="formControls col-5">
				<input type="text" onfocus="WdatePicker()" class="input-text delete_time" value="" placeholder="" id="" name="delete_time">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="提交">
			</div>
		</div>
	</form>
	<div id="allmap"></div>
</div>
	<!-- 添加界面结束 -->
	<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/getUrl.js"></script>
	<script type="text/javascript" src="Tpl/Admin/common/family/table.js"></script>
	<script type="text/javascript" src="Tpl/Admin/common/family/dataDel.js"></script>
	<!-- 家庭添加 -->
	<script type="text/javascript" src="__PUBLIC__/lib/Validform/5.3.2/Validform.min.js"></script> 
	<script type="text/javascript" src="Tpl/Admin/common/family/getDict.js"></script>
	<script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.min.js"></script>
	<script type="text/javascript" src="Tpl/Admin/common/family/addAjax.js"></script>
	<script type="text/javascript">
		

//权限复选框
// $(document).on("click",".perTableTbody checkbox");

/*
参数解释：
title	标题
url		请求的url
id		需要操作的数据id
w		弹出层宽度（缺省调默认值）
h		弹出层高度（缺省调默认值）
*/
// 全局
var info={
	pk:0,//添加返回家庭主键
	index:'',//添加家庭layer索引
}

$(function(){
	$(".familyAdd").hide();
	var roomId=$.getUrlVar('roomId');
	if(roomId){
		$(".addfamily").attr("uid",roomId);
	}else{
		$(".addfamily").hide();
	}
	layer.config({
    	extend: 'extend/layer.ext.js'
	});

})
/*家庭添加*/
function family_create(title,url,w,h,obj){
	var uid=$(obj).attr("uid");//roomId
	info.index=layer.open({
			type: 1,
			area: ['800px', '400px'],
			fix: false, //不固定
			maxmin: true,
			shade:0.4,
			title: title,
			content:$(".familyAdd"),
			end:function(){
				$("#familyTable").dataTable().api().draw();
				if(info.pk){
					newPage(info.pk)
				}
			}
		});



	// layer.prompt({
	//     title: '请为当前家庭赋予二位编号',
	//     formType: 0 //prompt风格，支持0-2
	// }, function(no,index, elem){
	// 	layer.close(index);
	// 	addFamily(title,url,uid,no);

	// });
	
}
// 选项卡跳转
 function newPage(id){
    // 跳转到选项卡
    var bStop=false;
    var bStopIndex=0;
    // var _href=$(obj).attr('_href');
    var _href='/index.php?m=Admin&c=FamilyMember&a=index'+'&familyId='+id;
    // var _titleName=$(obj).attr("data-title");
    var _titleName="家庭成员管理";
    var topWindow=$(window.parent.parent.parent.document);
    var show_navLi=topWindow.find("#min_title_list li");
    show_navLi.each(function() {
      if($(this).find('span').attr("data-href")==_href){
        bStop=true;
        bStopIndex=show_navLi.index($(this));
        return false;
      }
    });
    if(!bStop){
      creatIframe(_href,_titleName);
      min_titleList();
    }
    else{
      show_navLi.removeClass("active").eq(bStopIndex).addClass("active");
      var iframe_box=topWindow.find("#iframe_box");
      iframe_box.find(".show_iframe").hide().eq(bStopIndex).show().find("iframe").attr("src",_href);
    }
 }
/*管理员-权限-编辑*/
$(document).on("click",".familyEdit",function(){
	var roomId=$.getUrlVar('roomId');
	var id=$(this).attr("uid");
	layer.open({
		type: 2,
		area: ['800px', '400px'],
		fix: false, //不固定
		maxmin: true,
		shade:0.4,
		title: "家庭编辑",
		content:'/index.php?m=Admin&c=Family&a=modify'+'&id='+id+'&roomId='+roomId,
	});
});


// 查看详情
$(document).on("click",".familyBtn",function(){
	var familyId=$(this).attr("uid");
	var index=layer.open({
		type: 2,
		area: ['1720px', '500px'],
		fix: false, //不固定
		maxmin: true,
		shade:0.4,
		title: "家庭成员",
		content:'/index.php?m=Admin&c=FamilyMember&a=index'+'&familyId='+familyId,
	});
	layer.full(index);
});
</script>
</body>
</html>